Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ObjectDisposedException on NetworkManager after shutting down the Transport #3142

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

EmandM
Copy link
Contributor

@EmandM EmandM commented Nov 26, 2024

Ensures that UnityTransport is marked as Disconnected after shutting down. This ensures that no exceptions are thrown when trying to use the transport after it has been shut down.

This PR also adds a warning message when a UnityTransport has a NetworkManager and UnityTransport.Shutdown() has been called outside of NetworkManager.Shutdown() as shutting down the UnityTransport directly will result in unexpected disconnection behaviour (connected clients will not get Disconnect events and pending messages may be dropped).

fix: #3118

Changelog

  • Fixed: Issue where an ObjectDisposedException was thrown when calling NetworkManager.Shutdown() after calling UnityTransport.Shutdown()

Testing and Documentation

  • Unit tests have been added to UnityTransportTests to ensure exceptions are not thrown when using the transport after shutting it down.
  • No documentation changes or additions were necessary.

@EmandM EmandM requested a review from a team as a code owner November 26, 2024 19:57
@EmandM EmandM merged commit 17f7f25 into develop-2.0.0 Nov 26, 2024
24 checks passed
@EmandM EmandM deleted the fix/exception_after_transport_shutdown branch November 26, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants